#include <stdio.h>
#include <fcntl.h>
#include "erza_matrix_lib.h"
#include "config_default.h"
#include "ukf.h"
#include "ahrs.h"

#define SERIAL_PORT "/dev/ttyS0"

int readPort(void) {

	int fd = open(SERIAL_PORT, O_RDONLY | O_NOCTTY);
	if (fd == -1) {
		/* Could not open the port. */
		perror("open_port: Unable to open /dev/ttyS0 - ");
	}

	char buffer[32];
	while (1) {
		int n = read(fd, buffer, sizeof(buffer));
		printf("n: %d\n"+n);
		printf("%s\n", buffer);
		if (n < 0)
			fputs("read failed!\n", stderr);
	}
	return 1;
}
